#ifndef _TCPCONNECTION_H
#define _TCPCONNECTION_H

#include "01_InetAddress.hpp"
#include "02_Socket.hpp"
#include "03_SocketIO.hpp"
#include <string>

namespace xy
{
class TCPconnection
{
public:
    TCPconnection(int);
    ~TCPconnection() = default;

    InetAddress get_local_address();
    InetAddress get_peer_address();
    void send(const std::string&);
    std::string receive();
    void shutdown();
    bool is_closed();
    std::string tostring() const;

private:
    Socket _sock;
    SocketIO _sockIO;
    InetAddress _localAddr;
    InetAddress _peerAddr;

};

}


#endif
